import java.util.Scanner;
public class test14 {
    public static void main(String[] args) {
        //二进制1的个数
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        while( n!= 0){
            n = n & (n-1);
            count++;
        }
        System.out.println(count);
    }
    public static void main4(String[] args) {
        //求俩个整数的最大公约数
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = a % b;
        while(c !=0){
            a = b;
            b = c;
            c = a%b;
        }
        System.out.println(b);
    }
    public static void main3(String[] args) {
        //求1/1-1/2+1/3-1/4+.....+1/99-1/100
        double sum = 0;
        int flg = 1;
//        for (int i = 1; i <= 100; i++) {
//            if(i%2!=0){
//                sum+=(1.0/i);
//            }
//            else{
//                sum-=(1.0/i);
//            }
//        }
        for (int i = 1; i <= 100; i++) {
            sum=sum+1.0/i*flg;
            flg = -flg;
        }
        System.out.println(sum);
    }

    public static void main2(String[] args) {
        //求100——n的所有水仙花数
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个整数 n: ");

        int a = scanner.nextInt();
        for(int i = 100; i < a; i++){
            int count = 0;
            int tmp = i;
            while(tmp != 0){
                count++;
                tmp/=10;
            }
            tmp = i;
            int sum = 0;
            while(tmp!=0){

               sum += Math.pow(tmp % 10,count);
                tmp /=10;
            }
            if(sum == i){
                System.out.println(i + "是水仙花数");
            }
        }
    }







    public static void main1(String[] args) {
        //输入数字 多组输入 用 * 打印X型图案
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()){
            int a = in.nextInt();
            for(int i = 0; i < a ;i++){
                for(int j = 0; j < a; j++){
                    if(i == j || i+j == (a-1)){
                        System.out.print("*");
                    }
                    else{
                        System.out.print(" ");
                    }
                }
                System.out.println();
            }
        }


    }
}
